#include <stdio.h>

int main(int argc, const char *argv[])
{
	char arr[32] = {0};
	int i = 0;
	int count = 0;	//计算字符串长度
	int ret = 0;
	char* p = arr;
	
	printf("请输入一个范围是0-9的字符串>");
	scanf("%s", arr);
	for(count = 0; *p; count++)
	{
		p++;
	}
	p = arr;
	for(i = 0; i < count; i++)
	{
		if(*p != 0)
		{
			ret = ret * 10 + (*p - '0');
		}
		p++;
	}
	printf("%d\n", ret);

	return 0;
}
